﻿@using System.Reflection;
@using YUCodeGen.Utils;
@model  PropertyInfo[]
@{
    Layout = null;
}
<div class="component list">
    <table datatable [dtOptions]="dtOptions" class="row-border hover">
        <thead>
            <tr>
                @foreach (PropertyInfo pinfo in Model)
                {
                    if (PageUtil.IsListFiled(pinfo))
                    {
                    <th>@pinfo.Name</th>
                    }
                }
            </tr>
        </thead>
        <tbody *ngIf="data?.length != 0">
            <tr *ngFor="let item of data">
                @foreach (PropertyInfo pinfo in Model)
                {
                    if (PageUtil.IsListFiled(pinfo))
                    {
                    <td>{{ item.@pinfo.Name }}</td>
                    }
                }
            </tr>
        </tbody>
        <tbody *ngIf="data?.length == 0">
            <tr>
                <td colspan=" @Model.Count() " class="no-data-available">No data!</td>
            </tr>
        <tbody>
    </table>
</div>  